<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.kamus.model.PasanganKata"%>
<%@page import="com.kamus.manager.PasanganKataIGMgr"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.kamus.Constants" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <body>
        <form action="PasanganKataServlet" method="POST">
            <input type="hidden" name="<%=Constants.TYPE%>" value="<%=Constants.IND_GAUL%>"/>
            <h1>List Kosakata Indonesia - Gaul</h1>
            <table border="0" width="100%">
                <tr>
                    <td colspan="4" align="right">
                        <input type="submit" name="<%=Constants.ACTION%>" value="<%=Constants.CREATE%>"/>
                        <input type="submit" name="<%=Constants.ACTION%>" value="<%=Constants.DELETE%>"/>
                    </td>
                </tr>
                <tr>
                    <td width="5%"></td>
                    <td width="5%">ID</td>
                    <td width="45%">Indonesia</td>
                    <td width="45%">Gaul</td>
                </tr>

                <%
                            List<PasanganKata> list = new ArrayList<PasanganKata>();
                            list = PasanganKataIGMgr.getInstance().getKatas();
                            PasanganKata pKata = null;
                            String warna = "";
                            int i = 0;
                            for (Iterator<PasanganKata> it = list.iterator(); it.hasNext();) {
                                pKata = it.next();
                                if (i % 2 == 0) {
                                    warna = "#FFFFFF";
                                } else {
                                    warna = "#A0CFEC";
                                }
                %>
                <tr>
                    <td><input type="checkbox" name="item" value="<%=pKata.getId()%>"/></td>
                    <td bgcolor="<%=warna%>"><a href="KosakataForm.jsp?type=ig&id=<%=pKata.getId()%>"><%=pKata.getId()%></a></td>
                    <td bgcolor="<%=warna%>"><%=pKata.getIndonesia()%></td>
                    <td bgcolor="<%=warna%>"><%=pKata.getGaul()%></td>
                </tr>
                <%
                                i++;
                            }
                %>
                <tr>
                    <td colspan="4" align="right">
                        <input type="submit" name="<%=Constants.ACTION%>" value="<%=Constants.CREATE%>"/>
                        <input type="submit" name="<%=Constants.ACTION%>" value="<%=Constants.DELETE%>"/>
                    </td>
                </tr>
            </table>
        </form>

    </body>
</html>
